import request from '@/utils/request'

// 查询检测方法列表
export function listMethod(query) {
  return request({
    url: '/lims/store/method/list',
    method: 'get',
    params: query
  })
}

// 根据方法关键字模糊查询检测方法列表
export function queryMethodList(query) {
  return request({
    url: '/lims/store/method/methodList',
    method: 'get',
    params: query
  })
}

// 查询检测方法详细
export function getMethod(methodId) {
  return request({
    url: '/lims/store/method/' + methodId,
    method: 'get'
  })
}

// 修改检测方法
export function updateMethod(data) {
  return request({
    url: '/lims/store/method',
    method: 'put',
    data: data
  })
}

// 删除检测方法
export function delMethod(methodId) {
  return request({
    url: '/lims/store/method/delete/' + methodId,
    method: 'delete'
  })
}

// rowclick 仪器回显
export function getInstMethod(methodId) {
  return request({
    url: '/lims/store/instrument/' + methodId,
    method: 'get'
  })
}

// rowclick 分析步骤回显
export function getmethodStep(methodId) {
  return request({
    url: '/lims/store/methodStep/' + methodId,
    method: 'get'
  })
}

// rowclick 分析步骤回显
export function getmethodAccuracy(methodId) {
  return request({
    url: '/lims/store/methodAccuracy/' + methodId,
    method: 'get'
  })
}
// 获取前处理列表
export function gethandleList(methodId) {
  return request({
    url: '/lims/store/method/handleList/' + methodId,
    method: 'get',
  })
}

// 检测项目弹出框表格
export function getJcxmList(query) {
  return request({
    url: '/lims/store/methodQc/jcxmList',
    method: 'get',
    params: query
  })
}

//样品描述回显 
export function getSample(methodId) {
  return request({
    url: '/lims/store/sample/' + methodId,
    method: 'get'
  })
}

//结果表示回显 
export function getResult(methodId) {
  return request({
    url: '/lims/store/formula/list/' + methodId,
    method: 'get'
  })
}

// tab6结果表示保存
export function addResult(data) {
  return request({
    url: '/lims/store/formula',
    method: 'post',
    data: data
  })
}

//原理与试剂回显
export function getmethodYlAndReagent(methodId) {
  return request({
    url: '/lims/store/methodYlAndReagent/' + methodId,
    method: 'get'
  })
}

// 质控措施回显
export function getmethodQc(methodId) {
  return request({
    url: '/lims/store/methodQc/list/' + methodId,
    method: 'get'
  })
}

// tab9回显
export function getmethodDj(query) {
  return request({
    url: '/lims/priceConfig/list',
    method: 'get',
    params: query
  })
}

// tab9保存
export function priceSave(data) {
  return request({
    url: '/lims/priceConfig',
    method: 'post',
    data: data
  })
}

//tab4检测项目更改
export function getChangeJcxmList(query) {
  return request({
    url: '/lims/store/sample/jcxmList',
    method: 'get',
    params: query
  })
}

// tab1个性保存
export function addMethod(data) {
  return request({
    url: '/lims/store/method',
    method: 'post',
    data: data
  })
}

// 新接口
export function addJgbs(data) {
  return request({
    url: '/lims/store/formula',
    method: 'post',
    data: data
  })
}

// tab4个性保存
export function addSample(data) {
  return request({
    url: '/lims/store/sample',
    method: 'post',
    data: data
  })
}

// 计量单位库同步
export function postMethod() {
  return request({
    url: '/lims/store/method/syn',
    method: 'post',
    timeOutValidate: false,
  })
}

// 计量单位库同步缓存
export function getMethodStatus() {
  return request({
    url: '/lims/store/method/status',
    method: 'get',
  })
}

// 查询检测方法列表
export function listMethod1(query) {
  return request({
    url: '/lims/template/table/method/methodList',
    method: 'get',
    params: query
  })
}